import { configureStore } from '@reduxjs/toolkit'
import { useSelector, TypedUseSelectorHook, useDispatch } from 'react-redux'
import layoutStoreReducer from './layout.store'

const store = configureStore({
	reducer: {
		layoutStore: layoutStoreReducer,
	}
})

export type GetStateType = typeof store.getState
export type DispatchType = typeof store.dispatch
export type IRootState = ReturnType<GetStateType>
export const useAppSelector: TypedUseSelectorHook<IRootState> = useSelector
export const useAppDispatch: () => DispatchType = useDispatch

export default store
